package com.hzzc.api;

import com.hzzc.BizException;
import com.hzzc.Result;
import retrofit.http.Body;
import retrofit.http.Headers;
import retrofit.http.POST;

/**
 * 用户服务
 * <p>
 * --用户登录服务
 * --用户登录验证服务
 */
public interface UserLoginService {

    /**
     * 登录
     *
     * @return
     */
    @POST("/sso/login")
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    SSOLoginModel login(@Body LoginBean loginBean) throws BizException;


    /**
     * 权限检测
     */
    @POST("/sso/login/check")
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    Result<String> checkAuthority(@Body CheckBean checkBean) throws Exception;

    /**
     * 获取用户的权限视图
     *
     * @param appCode
     * @param code
     * @return
     * @throws BizException
     */
    Result<SSOApplicationUserAuthorityView> getUserApplicationUserAuthorityView(String appCode, String code) throws BizException;


    /**
     * 登出
     */
    @POST("/sso/logout")
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    boolean logout(@Body LogoutBean logoutBean) throws Exception;


}
